package fei.zhou.lambdalearn.demo6;

import java.util.*;
import java.util.stream.Stream;

public class Demo2 {

    public static void main(String[] args) {
        // Collection体系的集合可以使用默认方法stream​()生成流
        List<String> list = new ArrayList<>();
        list.stream();

        //Map体系的集合间接的生成流
        Map<String, Object> map = new HashMap<>();
        Set<String> keys = map.keySet();
        Collection<Object> values = map.values();
        Set<Map.Entry<String, Object>> entries = map.entrySet();

        Stream<String> stream = keys.stream();
        Stream<Object> stream1 = values.stream();
        Stream<Map.Entry<String, Object>> stream2 = entries.stream();

        //数组可以通过Stream接口的静态方法of​(T... values)生成流

        String[] arr = new String[10];
        Stream<String> stream3 = Stream.of(arr);
        Stream<Integer> stream4 = Stream.of(1, 2, 3);


    }

}